﻿using System;
using System.Collections.Generic;
using System.Text;

namespace PSAMMatrixCloud.TransferSecret.PSAMMatrix
{
    public class MessagePsam
    {
        public MessagePsam(byte[] data)
        {
            PHY_ID = new byte[2];
            TID = new byte[6];
            APDU_LIST = new byte[data.Length - 9];

            STATUS = data[0];
            Array.ConstrainedCopy(data, 1, PHY_ID, 0, 2);
            Array.ConstrainedCopy(data, 3, TID, 0, 6);
            Array.ConstrainedCopy(data, 9, APDU_LIST, 0, data.Length - 9);
        }

        /// <summary>
        /// 指令类型
        /// </summary>
        public byte STATUS { get; set; }

        public byte[] PHY_ID { get; set; }

        /// <summary>
        /// 消息ID
        /// </summary>
        public byte[] TID { get; set; }

        /// <summary>
        /// 拼接的COS指令原语
        /// </summary>
        public byte[] APDU_LIST;
    }
}
